﻿using SqlSugar;
using Zhp.SqlSugar.Entity;

namespace Zhp.SqlSugar.Trigger
{
    public abstract class BaseTriggerService<InEntity, TKey> : ITriggerService<InEntity, TKey> where InEntity : BaseEntity<TKey>, new()
    {
        public virtual void Inserted(ISqlSugarClient context, InEntity entity)
        {

        }

        public virtual void InsertedRange(ISqlSugarClient context, List<InEntity> entity)
        {

        }

        public virtual void Updated(ISqlSugarClient context, InEntity entity)
        {

        }

        public virtual void UpdatedRange(ISqlSugarClient context, List<InEntity> entity)
        {

        }

        public virtual void Deleted(ISqlSugarClient context, InEntity entity)
        {

        }

        public virtual void DeletedRange(ISqlSugarClient context, List<InEntity> entity)
        {

        }


        public virtual Task InsertedAsync(ISqlSugarClient context, InEntity entity)
        {
            return Task.CompletedTask;
        }

        public virtual Task InsertedRangeAsync(ISqlSugarClient context, List<InEntity> entity)
        {
            return Task.CompletedTask;
        }

        public virtual Task UpdatedAsync(ISqlSugarClient context, InEntity entity)
        {
            return Task.CompletedTask;
        }

        public virtual Task UpdatedRangeAsync(ISqlSugarClient context, List<InEntity> entity)
        {
            return Task.CompletedTask;
        }

        public virtual Task DeletedAsync(ISqlSugarClient context, InEntity entity)
        {
            return Task.CompletedTask;
        }

        public virtual Task DeletedRangeAsync(ISqlSugarClient context, List<InEntity> entity)
        {
            return Task.CompletedTask;
        }

    }
}
